<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript">
	var stts;
	$(".tab_menu  strong").hover(function() {
		var obj = $(this);
		stts = setTimeout(function() {
			scur(obj);
		}, 300);
	}, function() {
		clearTimeout(stts);
	});
	$(".tab_menu  strong").click(function() {
		scur($(this));
	});
	function scur(obj) {
		if (!obj.hasClass("scur")) {
			var sval = obj.attr("class");
			obj.siblings().removeClass("scur");
			obj.addClass("scur");
			obj.parent().next().children().hide();
			obj.parent().next().find("._" + sval).show();
		}
	}
	function bodyInput(name) {
		return $(".Body " + name);
	}
	//== 
	function showDialog(width, height, msg, title) {
		var $mydialog=$(".mydialog");
		$mydialog.find(".menu").show();
		if (title == "" || typeof (title) == "undefined")
			$mydialog.find(".menu").hide();
		$mydialog.find(".dialog span:eq(0)").html(title);
		$mydialog.find(".dialog .context").html(msg);
		$mydialog.find(".dialog").css("width", width + "px");
		$mydialog.find(".dialog .context").css("height", height + "px");
		var t = ($(window).height() - (height + 50)) / 2;
		$mydialog.find(".dialog").css({
			"z-index" : "999999",
			"top" : t + "px",
			"left" : ($(document).width() - $(".mydialog .dialog").width()) / 2 + "px"
		});
		$mydialog.fadeIn();
		fixBody();
	}

	function closeDialog() {
		$(".mydialog").fadeOut();
	}
	$(function() {
		var dragging = false;
		var iX, iY;
		$(".dialog .menu").mousedown(function(e) {
			dragging = true;
			iX = e.clientX - $(this).parent()[0].offsetLeft;
			iY = e.clientY - $(this).parent()[0].offsetTop;
			return false;
		});
		document.onmousemove = function(e) {
			if (dragging) {
				var e = e || window.event;
				var oX = e.clientX - iX;
				var oY = e.clientY - iY;
				$(".dialog").css({
					"left" : oX + "px",
					"top" : oY + "px"
				});
				return false;
			}
		};
		$(document).mouseup(function(e) {
			dragging = false;
			e.cancelBubble = true;
		});
	});
	var errCount=0;
	function ajaxLogin(obj){
		var $login_name=$(obj).find("input[name=login_name]");
		var $password=$(obj).find("input[name=password]");
		var $validate=$(obj).find("input[name=validate]");
		//=====
		if($login_name.val()=="" )
			return setError("请输入帐号！",$login_name);
		if(!(isEmail($login_name.val()) || isMobile($login_name.val())))
			return setError("请输入正确的帐号[手机号或邮箱]！",$login_name);  
		if($password.val()=="" )
			return setError("请输入密码！",$password);
		if($password.val().length<8 || $password.val().length>24)
			return setError("密码长度在 8 ~ 24 位之间！",$password); 
		if(errCount>3 && $validate.val()=="")
			return setError("请输入验证码！",$validate); 
		setError("",null);
		sendRequest("${ctx}/login/ajaxLoginAction.html",$(obj).serialize(),function(data){
			alert('aa');
			alert(data.retCode);
			if(data.retCode==1){
				window.location.reload(true);
			}else{
				alert("aab");
				$(".error span").text(data.retMsg);
				errCount=data.obj;
				if(errCount>3){
					$(obj).find(".validateImg").parent().slideDown();
					getValidateImg($(obj).find(".validateImg"));
				};
			}
		});
		return false;
	}
	function setError(str,obj){
		$(".error span").text(str);
		if(obj!=null) 
			obj.focus();
		countdown(5,function(time){
		},function(){
			$(".error span").text("");
		});
		return false;
	}
</script>
<div class="clear"></div>
<div class="mydialog hide">
	<div class="mask"></div>
	<div class="dialog content shadown50 radius5">
		<div class="menu pl10 pt5 " style="cursor: move; background-color: #F0F0F0;">
			<span class="fl"></span>
			<div class="clear "></div>
		</div>
		<span class="btnclosed" onclick="closeDialog()">╳</span>
		<div class="context" style="overflow-y: auto;"></div>
	</div>
</div>
<!-- ==================================================================================== -->
<!-- 登录框 -->
<div class="hide loginDIV" >
	<div class="login-content block fl" style="background:url('${ctx}/resource/img/W600MAIL.png')  no-repeat top">
		<div class="shadown"
			style="margin: auto; border: 4px solid white; background-color: white; width: 70px; height: 70px; border-radius: 70px; background: url('${ctx}/resource/img/head.png') center; background-size: 100px;">

		</div>
		<p class="error" id="common_errors">&nbsp;<span></span></p>
		<form id="ajaxLogin_form" method="post"  >
			<ul>
				<li  ><span class="tip">手机号/邮箱/用户名</span> <input type="text" name="login_name" tabindex="1" /></li>
				<li  ><span class="tip">请输入密码</span> <input tabindex="2" type="password" name="password" /></li>
				<li class="hide"><span class="tip">请输入验证码</span> <input tabindex="3" type="text" name="validate" style="width: 40%" />
					<img  class="validateImg fr" onclick="getValidateImg(this)"/>
				</li>
				<li ><a href="${ctx}/register.html">免费注册&gt;</a></li>
				<li><input type="button" onclick="ajaxLogin($('.mydialog form'))" class="md_basic_btn" value="登&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;录" /></li>
			</ul>
		</form>
	</div>
</div>
<!-- ==================================================================================== -->
<!--  -->
<div class="Bottom h150 ">
	<div class="baseWidth block">
		<div class="block h30"></div>
		<div>
			<ul>
				<li style="width: 30%;">
					<div class="block Tel fl"></div>
					<div class="fl ">
						<strong class="col3">400-800-8820</strong>
						<p>网贷咨询热线</p>
						<p>服务时间 9:00-18:00</p>
					</div>
				</li>
				<li style="width: 18%"><strong>用户帮助</strong>
					<p>
						<a href="">网站导航</a>
					</p>
					<p>
						<a href="">意见或建议</a>
					</p></li>
				<li style="width: 18%"><strong>关于我们</strong>
					<p>
						<a href="">联系方式</a>
					</p>
					<p>
						<a href="">广告服务</a>
					</p></li>
				<li style="width: 18%"><strong>关注我们</strong>
					<p>
						<a href="">关于支付之家</a>
					</p>
					<p>
						<a href="">联系方式</a>
					</p>
					<p>
						<a href="">广告服务</a>
					</p></li>
				<li style="width: 16%"><strong>用户帮助</strong>
					<p>
						<a href="">网站导航</a>
					</p>
					<p>
						<a href="">意见或建议</a>
					</p></li>
			</ul>
		</div>
	</div>
</div>
<div style="background: #505050; min-width: 1000px" class="block h30">
	<div class="baseWidth block">
		<div class="block h30 fl" style="width: 100%">
			<p class="col1" style="line-height: 30px; text-align: center; width: 100%">Copyright©2008-2014 baofoo.com. All Rights Reserved 宝付版权所有 | 增值电信业务经营许可证：沪B2-20110023 | ICP备案：沪ICP备09005103号-2</p>
		</div>
	</div>
</div>
<ul class="fixDiv">
	<!-- <li class="weixin"></li> -->
	<li class="toTop" style="display: none;"></li>
</ul>
</body>
</html>
<style type="text/css">
.fixDiv {
	position: fixed;
	right: 20px;
	bottom: 40px;
	height: auto;
	display: block;
	width: 40px;
	list-style: none;
}

.fixDiv li {
	height: 40px;
	display: block;
	margin: 1px;
	cursor: pointer;
}
/*  */
.toTop {
	background: url("${ctx}/resource/img/side-icon02.png") no-repeat center;
	background-color: #02A2AA;
}

.toTop:hover {
	background-color: #444444;
}

.weixin {
	background: url("${ctx}/resource/img/side-icon01.png") no-repeat center;
	background-color: #DADBDD;
}

.mydialog .mask {
	z-index: 9999;
	position: fixed;
	left: 0px;
	top: 0px;
	bottom: 0px;
	right: 0px;
	background-color: rgba(0, 0, 0, 0.175)
}

.mydialog .content {
	z-index: 9999;
	position: fixed;
	left: 50%;
	top: 50%;
}

.content {
	background: white;
	border: 1px solid #F0F0ED;
	margin-bottom: 10px;
}

.content span {
	text-align: center;
}

.content .menu {
	line-height: 30px;
	font-weight: 900;
	border-bottom: 1px dashed #e4dcd0;
}

.btnclosed {
	width: 20px;
	height: 20px;
	line-height: 20px !important;
	text-align: center;
	background-color: #E5E5E5;
	font-size: 10px;
	border-radius: 20px;
	color: white;
	display: block;
	position: absolute;
	top: 10px;
	right: 10px;
	border-radius: 20px;
}

.btnclosed:hover {
	background-color: #D8D8D8;
	cursor: pointer;
}
/*  */
</style>
<script type="text/javascript">
	$(function() {
		fixBody();
		$(".toTop").click(function() {
			$("html, body").animate({
				scrollTop : 0
			}, 500);
		});
		var $toTop = $(".toTop");
		$(window).bind("scroll", function() {
			var d = $(document).scrollTop(), e = $(window).height();
			0 < d ? $toTop.fadeIn() : $toTop.fadeOut();
		});
	})
	function fixBody(){
		$(":text,:password").focus(function() {
			if ($(this).prev().hasClass("tip")) {
				$(this).prev().hide();
			}
		});
		$(":text,:password").blur(function() {
			if ($(this).prev().hasClass("tip") && $(this).val() == "") {
				$(this).prev().show();
			}
		});
	}
	function getValidateImg(obj) {
		$(obj).attr("src", "${ctx}/public/getValidate.html?timestamp=" + new Date().getTime());
	}
</script>
<!-- ===============END================= -->
